package Main;

import java.util.LinkedHashMap;
import java.util.Map;

/**
 * 配置包文件静态类
 */
public class YamlConfig {

    /**
     * 获取配置文件
     * @param name 获取名字
     */
    public static Map<String , Object> getConfig(String name){
        switch (name.toLowerCase()){//小写名字
            case "mysql":
                return getMysqlConfig();
            case "config":
                return getBaseConfig();
            default:
                return null;
        }
    }

    /**
     * 获取mysql配置文件内容
     */
    private static Map<String , Object> getMysqlConfig(){
        Map<String , Object> data = new LinkedHashMap<>();
        data.put("mysql_url#Tips" , "URL of database connection");
        data.put("mysql_url" , "localhost");
        data.put("mysql_table#Tips" , "Table name of database connection");
        data.put("mysql_table" , "mina");
        data.put("mysql_username#Tips" , "UserName of database connection");
        data.put("mysql_username" , "username");
        data.put("mysql_password#Tips" , "PassWord of database connection");
        data.put("mysql_password" , "password");
        data.put("mysql_port#Tips" , "Port of database connection");
        data.put("mysql_port" , "3306");
        return data;
    }

    /**
     *获取基础配置文件内容
     */
    private static Map<String , Object> getBaseConfig(){
        Map<String , Object> data = new LinkedHashMap<>();
        data.put("AppID#Tips" , "AppID");
        data.put("AppID" , "######");
        data.put("AppSecret#Tips" , "AppSecret");
        data.put("AppSecret" , "#####");
        return data;


    }




}
